set(UTILS_EXTRA_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/utils_win.c PARENT_SCOPE)

set(FSNOTIFY_EXTRA_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/fsnotify.c PARENT_SCOPE)
set(FSNOTIFY_EXTRA_LIBS utils PARENT_SCOPE)

if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/rpc/win_sdk_env.cmake")
	message(FATAL_ERROR
		"Can't find 'rpc/win_sdk_env.cmake'.\n"
		"You must create it by yourself.\n"
		"See 'rpc/README.txt' for details.")
endif()
add_subdirectory(rpc)

include(rpc/win_sdk_env.cmake)
add_library(rpcrt4_imp UNKNOWN IMPORTED)
set_target_properties(rpcrt4_imp PROPERTIES
	IMPORTED_LOCATION "${WIN_IMPLIB_PATH}/RpcRT4.lib")

add_library(syncup-service_s_lib STATIC IMPORTED)
set_target_properties(syncup-service_s_lib PROPERTIES
	IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/rpc/syncup-service_s.lib"
	IMPORTED_LINK_INTERFACE_LIBRARIES rpcrt4_imp)

add_library(syncup-service_c_lib STATIC IMPORTED)
set_target_properties(syncup-service_c_lib PROPERTIES
	IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/rpc/syncup-service_c.lib"
	IMPORTED_LINK_INTERFACE_LIBRARIES rpcrt4_imp)

add_subdirectory(test)